.\" A man page for lchage
.\" Copyright (C) 2005, 2012 Red Hat, Inc.
.\"
.\" This is free software; you can redistribute it and/or modify it under
.\" the terms of the GNU Library General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
.\" General Public License for more details.
.\"
.\" You should have received a copy of the GNU Library General Public
.\" License along with this program; if not, write to the Free Software
.\" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
.\"
.\" Author: Miloslav Trmač <mitr@redhat.com>
.TH lchage 1 "Nov 8 2012" libuser

.SH NAME
lchage \- Display or change user password policy

.SH SYNOPSIS
lchage [\fIOPTION\fR]... \fIuser\fR

.SH DESCRIPTION
Displays or allows changing password policy of \fIuser\fR.

.SH OPTIONS
.TP
\fB\-d\fR, \fB\-\-date\fR=\fIdays\fR
Set the date of last password change to \fIdays\fR after Jan 1 1970.

Set
.I days
to -1 to disable password expiration
(i.e. to ignore \fB\-\-mindays\fP, and \fB\-\-maxdays\fP and related settings).

Set
.I days
to 0 to enforce password change on next login.
(This also disables password expiration until the password is changed.)

.TP
\fB\-E\fR, \fB\-\-expire\fR=\fIdays\fR
Set the account expiration date to \fIdays\fR after Jan 1 1970.
Set \fIdays\fR to -1 to disable account expiration.

.TP
\fB\-i\fR, \fB\-\-interactive\fR 
Ask all questions when connecting to the user database,
even if default answers are set up in
.B libuser
configuration.

.TP
\fB\-I\fR, \fB\-\-inactive\fR=\fIdays\fR
Disable the account after \fIdays\fR after password expires (after
the user is required to change the password).
Set
.I days
to -1 to keep the account enabled indefinitely after password expiration.

.TP
\fB\-l\fR, \fB\-\-list\fR
Only list current \fIuser\fR's policy and make no changes.

.TP
\fB\-m\fR, \fB\-\-mindays\fR=\fIdays\fR
Require at least \fIdays\fR days between password changes.
Set \fIdays\fR to 0 or -1 to disable this requirement.

If this value is larger than the value set by \fB\-\-maxdays\fP,
the user cannot change the password.

.TP
\fB\-M\fR, \fB\-\-maxdays\fR=\fIdays\fR
Require changing the password after \fIdays\fR since last password change.
Set \fIdays\fR to -1 to disable password expiration.

.TP
\fB\-W\fR, \fB\-\-warndays\fR=\fIdays\fR
Start warning the user \fIdays\fR before password expires (before
the user is required to change the password).
Set
.I days
to 0 or -1 to disable the warning.

.SH EXIT STATUS
The exit status is 0 on success, nonzero on error.

.SH NOTES
Note that \(lqaccount expiration\(rq
(set by \fB\-\-expire\fP)
is distinct from \(lqpassword expiration\(rq
(set by \fB\-\-maxdays\fP).
Account expiration happens on a fixed date regardless of password changes.
Password expiration is relative to the date of last password change.
